<!DOCTYPE html>
<html>

<head>
    <title>{$category.name|default="汽车列表"} {$category.seo_title} - {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$category.seo_keywords},{$site_info.site_seo_keywords|default=''}" />
    <meta name="description" content="{$category.seo_description},{$site_info.site_seo_description|default=''}">
    <include file="public@head" />
    <hook name="before_head_end" />
    <link href="__TMPL__/public/assets/css/slippry/slippry.css" rel="stylesheet">
</head>

<body class="body-black">
    <include file="public@nav" />
    <div class="container tc-main">
        <div class="list-head">
            <ul>
                <li id="tab" class="tab_1 {$category.id==0?'active': ''}"><a href="{:cmf_url('List/index')}">所有车型</a></li>
                <volist name="categorys" id="vo">
                    <neq name="vo:id" value="$rental_category">
                        <li id="tab" class="tab_2 {$vo.id==$category.id?'active': ''}"><a href="{:cmf_url('List/index',['id'=>$vo.id])}">{$vo.name}</a></li>
                    </neq>
                </volist>
            </ul>
            <div class="head-tip">汽车品牌大全</div>
            <div class="clearboth"></div>
        </div>
        <div class="list-breadcrumb">
            <a href="{:cmf_url('List/index',['id'=>$category.id])}">全部结果</a>
            <b></b><a href="{:cmf_url('List/index',['id'=>$category.id])}">选车中心</a>
            <notempty name="category.name"><b></b><span>{$category.name|default=''}</span></notempty>
            <notempty name="brand.name"><b></b><span>{$brand.name|default=''}</span></notempty>
        </div>
        <div>
            <form class="select-form" action="{:cmf_url('rental/List/index')}" method="get">
                <input type="hidden" name="id" value="{$category.id??''}" />
                <ul class="list-select">
                    <li>
                        <input type="hidden" name="brand" value="{$brand.id??''}" /> <span class="select-name"> <a select="brand" data="" href="javascript:;" >品牌</a></span>
                        <volist name="brands" id="vo" offset="0" length='20'>
                            <a select="brand" data="{$vo.id}" href="javascript:;" <notempty name="brand.id">{$brand.id==$vo.id?'class="active"':' '}</notempty>>{$vo.name}</a>
                        </volist>
                    </li>
                    <li>
                        <input type="hidden" name="rank" value="{$rank.id??''}" /> <span class="select-name"><a select="rank" data="" href="javascript:;" >车型</a></span>
                        <volist name="ranks" id="vo">
                            <a select="rank" data="{$vo.id}" href="javascript:;" <notempty name="rank.id">{$rank.id==$vo.id?'class="active"':''}</notempty>>{$vo.rank}</a>
                        </volist>
                    </li>
                    <li>
                        <input type="hidden" name="price_range" value="{$price_range.id??''}" /> <span class="select-name"><a select="price_range" data="" href="javascript:;" >价格</a></span>
                        <volist name="price_ranges" id="vo">
                            <a select="price_range" data="{$vo.id}" href="javascript:;" <notempty name="price_range.id">{$price_range.id==$vo.id?'class="active"':''}</notempty>>{$vo.price_range}</a>
                        </volist>
                    </li>
                    <li>
                        <input type="hidden" name="year" value="{$year.id??''}" /> <span class="select-name"><a select="year" data="" href="javascript:;" >年份</a></span>
                        <volist name="years" id="vo">
                            <a select="year" data="{$vo.id}" href="javascript:;" <notempty name="year.id">{$year.id==$vo.id?'class="active"':''}</notempty>>{$vo.year}</a>
                        </volist>
                        <a select="year" data="0" href="javascript:;" <present name="year.id">{$year.id==0?'class="active"':''}"</present>>新车</a>
                    </li>
                    <li>
                        <input type="hidden" name="emission" value="{$emission.id??''}" /> <span class="select-name"><a select="emission" data="" href="javascript:;" >排量</a></span>
                        <volist name="emissions" id="vo">
                            <a select="emission" data="{$vo.id}" href="javascript:;" <notempty name="emission.id">{$emission.id==$vo.id?'class="active"':''}</notempty>>{$vo.emission}</a>
                        </volist>
                    </li>
                </ul>
            </form>
        </div>


        <div class="">
            <div class="cars-hot-title">
                <h1 class="">热门车型推荐</h1>
                <div class="tip">HOT RECOMMENDED</div>
                <div class="clearboth"></div>
            </div>
            <div class="row">
                <empty name="cars">
                    <div class="text-center lose">没有找到您想要到，看看别的吧！</div>
                </empty>
                <volist name="cars" id="vo">
                    <div class="col-md-3 car-box">
                        <div class="tc-gridbox ">
                            <a href="{:cmf_url( 'rental/Car/index',array( 'id'=>$vo.id,'cid'=>$vo.category_id))}">
                                <div class="header">
                                    <div class="item-image">
                                        <present name="vo.more.thumbnail">
                                            <empty name="vo.more.thumbnail">
                                                <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                                <else/>
                                                <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive" alt="">
                                            </empty>
                                            <else/>
                                            <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                        </present>
                                    </div>
                                    <h3 class="title">
                                        {$vo.title}
                                    </h3>
                                    <div class="title price">
                                        <span class="now-price">一口价：{$vo.primary.price}万</span><span class="m-price">市场价：{$vo.primary.m_price}万</span>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
                </volist>
            </div>
            <div class="text-center">
                <ul class="pagination">{$page|default=''}</ul>
            </div>
        </div>

    </div>
    <div class="section ">
        <div class="container sectione-news">
            <div class="row text-center ">
                <widget name="last_news">
                    <div class="news-title">
                        <h1 class="">{$widget.title}</h1>
                        <div class="more"><a href="{:cmf_url('portal/List/index')}">》更多资讯</a></div>
                        <div class="clearboth"></div>
                    </div>
                    <div class="row" style="height:468px;">
                        <php>
                            $widget["vars"]["last_news_category_id"] = empty($widget["vars"]["last_news_category_id"])?1:$widget["vars"]["last_news_category_id"]; $widget_news_category_id_arr = explode(",",$widget["vars"]["last_news_category_id"]); $widget_thumb_category_id = $widget_news_category_id_arr[0];
                            $widget_text_category_id_1 = isset($widget_news_category_id_arr[1]) ?$widget_news_category_id_arr[1]:"$widget_thumb_category_id"; $widget_text_category_id_2 = isset($widget_news_category_id_arr[2]) ?$widget_news_category_id_arr[2]:
                            "";
                        </php>
                        <div class="col-md-5 news-tc-gribox">
                            <ul id="news-slippry" class="tc-gridbox">
                                <portal:articles limit="3" order="post.published_time DESC" categoryIds="$widget_thumb_category_id">
                                    <li>
                                        <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">
                                            <present name="vo.more.thumbnail">
                                                <empty name="vo.more.thumbnail">
                                                    <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive news-img" alt="">
                                                    <else/>
                                                    <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive news-img" alt="">
                                                </empty>
                                                <else/>
                                                <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive news-img" alt="">
                                            </present>
                                            <h3 class="news-post-title ">
                                                {$vo.post_title}
                                            </h3>
                                        </a>
                                    </li>
                                </portal:articles>
                            </ul>
                        </div>
                        <div class="col-md-4">
                            <portal:articles limit="4,2" order="post.published_time DESC" categoryIds="$widget_thumb_category_id">
                                <div class="tc-gridbox news-tc-gribox">
                                    <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">
                                        <div class="header">
                                            <div class="item-image">
                                                <present name="vo.more.thumbnail">
                                                    <empty name="vo.more.thumbnail">
                                                        <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive box-img" alt="">
                                                        <else/>
                                                        <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive box-img" alt="">
                                                    </empty>
                                                    <else/>
                                                    <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive box-img" alt="">
                                                </present>

                                            </div>
                                            <h3 class="news-post-title">
                                                {$vo.post_title}
                                            </h3>
                                        </div>
                                    </a>
                                </div>
                            </portal:articles>
                        </div>
                        <div class="col-md-3">
                            <notempty name="widget_text_category_id_1">
                                <ul class="news-tc-gribox list-style" style="margin-left: -30px;">
                                    <portal:articles limit="4" order="post.published_time DESC" categoryIds="$widget_text_category_id_1">
                                        <eq name="i" value="1">
                                            <div style="color:#c9caca;font-size:24px;font-weight: bold;">{:json_decode($vo.categories,true)[0]['name']}</div>
                                        </eq>
                                        <li>
                                            <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">
                                                {$vo.post_title}
                                             </a>
                                        </li>
                                    </portal:articles>
                                </ul>
                            </notempty>
                            <notempty name="widget_text_category_id_2">
                                <ul class="news-tc-gribox list-style" style="margin-left: -30px;">
                                    <portal:articles limit="4" order="post.published_time DESC" categoryIds="$widget_text_category_id_2">
                                        <eq name="i" value="1">
                                            <div style="color:#c9caca;font-size:24px;font-weight: bold;">{:json_decode($vo.categories,true)[0]['name']}</div>
                                        </eq>
                                        <li>
                                            <a href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">
                                                {$vo.post_title}
                                            </a>
                                        </li>
                                    </portal:articles>
                                </ul>
                            </notempty>
                        </div>
                    </div>
                </widget>
            </div>

        </div>
    </div>
    <div class="container">
        <hr class="no-margin" style="margin-top: 60px;" />
    </div>
    <include file="public@footer" />
    <include file="public@scripts" />
    <script src="__TMPL__/public/assets/js/slippry.min.js "></script>
    <script>
        $(function() {
            $("#news-slippry ").slippry({
                controls: false,
                transition: 'fade',
                useCSS: true,
                pagerClass: 'news-sy-pager',
                captions: false,
                speed: 1000,
                pause: 3000,
                auto: true,
                preload: 'visible'
            });

        });
        $('.list-select li a').click(function() {
            var url = $('.select-form').attr('action');
            var select = $(this).attr('select');
            var data = $(this).attr('data');
            $('.select-form').find('input[name=' + select + ']').val(data);
            var query = $('.select-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            //console.log(url);
            console.log(query);
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            console.log(url);
            window.location.href = url;
            // alert($(this).attr('elect-data'));
        });
    </script>

    <hook name="before_body_end" />
</body>

</html>